{#{% extends "base_navigation.html" %}#}
{% load static %}
<head>

    <title>确认</title>
{#    <link rel="stylesheet" href="{% static 'Form_Style/css/style-nav.css' %}">#}
{#    <link rel="stylesheet" type="text/css" href="{% static 'index/css/edit.css' %}">#}
    <link rel="stylesheet" type="text/css" href="{% static 'bootstrap-3.3.7-dist/css/bootstrap.min.css' %}">
    <style>
    .demo-input{padding-left: 10px; height: 38px; min-width: 262px; line-height: 38px; border: 1px solid #e6e6e6;  background-color: #fff;  border-radius: 2px;}
         body{padding: 20px;}
     </style>
</head>


<body>
<div class="inner-wrapper">
    {% if condition_action == "gen_html_process" %}
    <h2>确认总用例文件：<a class="directory" href="{{ file.get_url }}">{{ file.get_url }}</a></h2>
    <h3>此项操作最终会输出测试报告html</h3>
    <form method="POST" action="{% url 'file_manage:gen_html_process' file.pk %}">
{#    {% else %}#}
{#    <h2>删除目录 <a class="directory" href="{{ directory.get_url }}">{{ directory.get_url }}</a></h2>#}
{#    <h3>它下面的所有文件和子目录、子目录的文件都会被统统删除，且无法恢复。</h3>#}
{#    <form method="POST" action="{% url 'file_manage:rmdir' directory.pk %}">#}

    {% csrf_token %}
    <table>
    {{ form }}
{#        <lable>app:</lable>#}
{#        <select name="search_T" onchange="change_country(this.value)" class="frm-field required">#}
{#            <option value="0">APP选择</option>#}
{#            <option value="JULONG">聚龙</option>#}
{#        </select>#}
    </table>
    <br>
    <button class="btn">我确定</button>
    </form>
        {% elif condition_action == "timed_task" %}
            <h2>确认定时运行总用例文件：<a class="directory" href="{{ file.get_url }}">{{ file.name }}</a></h2>
            <h3>此项操作最终会输出测试报告html（定时运行时间点必须至少大于十分钟）</h3>
            <form method="POST" action="{% url 'file_manage:timed_task' file.pk %}">


            {% csrf_token %}
            <table>
            {{ form }}
            </table>
{#                具体时间#}
{#                <div><label>#}
{#                    <input type="text" name="time_now" class="demo-input" placeholder="选择具体运行时间" id="time_now">#}
{#                </label>#}
{#                </div>#}
                <div class="form-group">
                <label for="exampleInputEmail1">时间范围：</label>
                    <input type="text" class="demo-input" placeholder="日期时间范围" id="test10" name="time_set">
                    </div>
                 <div class="form-group">
                <label for="exampleInputEmail1">时间间隔（周-日-小时）(0-0-0为仅执行一次）：</label>
                <input type="text" class="form-control" id="input_interval" placeholder="示例:0-3-5 (间隔时间3天加五小时)" name="interval_time">
              </div>
            <br>
            <button class="btn" onclick="check_up()">我确定</button>
            </form>




            <script src="{% static "index/laydate/laydate.js" %}"></script>
            <script>
                lay('#version').html('-v'+ laydate.v);
                    laydate.render({
                      elem: '#time_now'
                      ,type: 'datetime'
                    });
                laydate.render({
                  elem: '#test10'
                  ,type: 'datetime'
                  ,range: true
                });
                {#let regex = /^([0-9]{0-4})-([0-9]{0-4})-([0-9]{0-4})/i;#}
                {#function check_up(){#}
                {#    var tmp=document.getElementById('input_interval').value#}
                {#    expect(regex.test(tmp)).toBe(true)#}
                {##}
            </script>
    {% endif %}
    	{% if messages %}
    <script>
        {% for msg in messages %}
            alert('{{ msg.message }}');
        {% endfor %}
    </script>
	{% endif %}
</div>
</body>
